<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link href="css/select.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="artDialog/skins/default.css"
	type="text/css"></link>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="js/select-ui.min.js"></script>


<script type="text/javascript" src="artDialog/artDialog.min.js"></script>
<script type="text/javascript" src="artDialog/jquery.artDialog.min.js"></script>
<script type="text/javascript" src="artDialog/artDialog.plugins.min.js"></script>

<script type="text/javascript" src="js/util.js"></script>
<script language="javascript"  type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
  
<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 167  
	});
	$(".select3").uedSelect({
		width : 120
	});
	
	$.post("user!findByGName.action",{name:"系统管理员"},function(data){
		var arr = eval("("+data+")");
		var html = "<option value='0'>全部</option>";
		for(var i =0;i<arr.length;i++){
			html+="<option value='"+arr[i].id+"'>"+arr[i].name+"</option>";
		}
		$.post("user!findByGName.action",{name:"线路管理员"},function(d){
		 	arr = eval("("+d+")");
			for(var i =0;i<arr.length;i++){
				html+="<option value='"+arr[i].id+"'>"+arr[i].name+"</option>";
			}
			$("#cuser").html(html);
		
		});
	});
	$.post("user!findByGName.action",{name:"消缺员"},function(d){
		var  arr = eval("("+d+")");
		var html= $("#debugUser").html();
		for(var i =0;i<arr.length;i++){
			html+="<option value='"+arr[i].id+"'>"+arr[i].name+"</option>";
		}
		$("#debugUser").html(html);
	
	});
	
});
function exportExcel(){
		$.post("deBug!export.action",{
		"debugtaskUser.uid":$("#debugUser").val(),
		"debugtask.createUser":$("#cuser").val(),
		"debugtask.type":$("#type").val(),
		"sd":$("#sd").val(),
		"ed":$("#ed").val()
	},function(data){
		var json = eval("("+data+")");
		if(json.file!=""){
			window.open("xls/"+json.file+".xls");
		}else{
			defaultAlert("导出Excel","没有数据可以导出");
		}
	});
}
function statistics(pageIndex,pageSize){
	var d_1 = $("#sd").val();
	var d_2 = $("#ed").val();
	var e_1 = new Date(d_1).getTime();
	var e_2 = new Date(d_2).getTime();
	if(e_1>e_2){
		defaultAlert("创建时间","开始时间不能大于结束时间");
	}else{
		$.post("deBug!statistics.action",{
			"debugtaskUser.uid":$("#debugUser").val(),
			"debugtask.createUser":$("#cuser").val(),
			"debugtask.type":$("#type").val(),
			"sd":$("#sd").val(),
			"ed":$("#ed").val(),
			"pageIndex":pageIndex,
			"pageSize" : pageSize
		},function(data){
			var bean = eval("("+data+")");
			var rows = bean.rows;
			var html="";
			for(var i =0;i<rows.length;i++){
				html+="<tr><td>"+rows[i].id+"</td><td>"+rows[i].name+"</td>";
				html+="<td>"+rows[i].userName+"</td>";
				html+="<td>"+rows[i].time+"</td>";
				html+="<td>"+rows[i].type+"</td>";
				if(rows[i].receiptdebug==null){
					html+="<td>未解决</td><td>未解决</td>";
				}else{
					html+="<td>"+rows[i].receiptdebug.time+"</td>";
					html+="<td>"+rows[i].receiptdebug.description+"</td>";
				}
				html+="</tr>";
			}
			$("#info_list").html(html);
			var pager = pager2(bean,pageSize,"statistics");
			$(".pagin").html(pager);
			$('#info_list tr:odd').addClass('odd');
		});
	}
}
</script>
</head>
 
<body onload="statistics(1,8);">

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">信息统计</a></li>
    <li><a href="#">消缺记录统计</a></li>
    </ul>
    </div>
    
    <div class="formbody">
       
    <ul class="seachform">
    
    
    <li><label>创建人员</label>  
    <div class="vocation">
    <select class="select3" id="cuser">
    <option value="0">全部</option>
    <option>其他</option>
    </select>
    </div>
    </li>
    <li><label>消缺人员</label>
     <div class="vocation">
    <select class="select3" id="debugUser">
    <option value="0">全部</option>
    </select>
    </div>
    </li>
    
    <li><label>单据类型</label>  
    <div class="vocation">
    <select class="select3"  id="type">
    <option value="">全部</option>
    <option value="任务单">任务单</option>
    <option value="第一种单据">第一种单据</option>
    <option value="第二种单据">第二种单据</option>
    </select>
    </div>
   
    <li><label>创建时间</label>
    <input type="text"  id="sd" style="width:100px;"class="scinput"  readonly="readonly" onclick="WdatePicker()"/>-
    <input type="text"  id="ed" style="width:100px;"class="scinput" readonly="readonly" onclick="WdatePicker()"/></li>
    <li><label>&nbsp;</label><input name="" type="button" class="scbtn" value="查询" onclick="statistics(1,8)"/></li>
     <li><label>&nbsp;</label><input name="" type="button" class="scbtn" value="导出Excel" onclick="exportExcel()"/></li>
    
    </ul>
    
      
	</div> 
   <table class="tablelist">
    	<thead>
    	<tr>
        
        <th>任务编号</th>
        <th>任务名称</th>
        <th>创建人</th>
        <th>创建时间</th>
        <th>单据类型</th>
        
        <th>解决时间</th>
        <th>解决意见</th>
        </tr>
        </thead>
        <tbody id="info_list">
       
        </tbody>
    </table>
 
	<div class="pagin">
     </div>
    
  
    
</body>
</html>
